package com.titan.demo.common.services;

import java.util.ArrayList;
import java.util.List;

import com.titan.demo.common.dao.User;
import com.titan.demo.common.interfaces.IDemoService;

public class DemoServiceImpl implements IDemoService {
	private Integer port;
    public DemoServiceImpl() {
    }
	public DemoServiceImpl(Integer port) {
		this.port = port;
	}
	
	
	public String sayHello(String name) {
		System.out.println("run from " + name + " to " + port + "！");
		return "Hello " + name;
	}

	public List<User> getUsers() {
		List<User> list = new ArrayList<User>();
		list.add(new User("jack", 20, "男"));
		list.add(new User("tom", 21, "女"));
		list.add(new User("rose", 19, "女"));
		return list;
	}

	public void throwException() throws Exception {
		throw new Exception("zzz");
	}
}
